<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>个人信息-修改性别</title>
	<link rel="stylesheet" href="__PUBLIC__/Mobile/css/zhang.css">
	<script src="__PUBLIC__/Mobile/js/jquery-1.7.2.min.js"></script>
	<script src="__PUBLIC__/Mobile/Layer/layer.min.js"></script>
</head>
<style>
	.Logon1 input{width:5%; text-align:center;}
</style>
<body >
<section>
<!--修改昵称-->
<div class="lm">
	<a href="javascript:history.back(-1);">
		<img src="__PUBLIC__/Mobile/images/return.png" style="height:22px; padding-left:2%; line-height:22px; width:6%; padding-top:2%;" class="left">
	</a>
    <span class="left size20">修改性别 </span>
</div>
<div class="Logon1" style="text-align:center;">
        	<if condition="$data['sex'] eq m">
	        	<label>男性：</label>
	        			<input class="rad" type="radio" name="sex" value="m" checked="checked"/>
	        			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<label>女性：</label>
				 		<input class="rad" type="radio" name="sex" value="w"/>
			<else />
				<label>男性：</label>
	        			<input class="rad" type="radio" name="sex" value="m" />
	        			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<label>女性：</label>
				 		<input class="rad" type="radio" name="sex" value="w" checked="checked"/>
			</if>
</div>
<button class="immediately2 size26" style="border:none;" id="button">修改性别</button>
</section>
<script>
			$("#button").click(function(){
				var sexs = $('input[name="sex"]:checked').val();//获取被选中sex按钮的值 
				$.ajax({
					url:"{:U('Mycenter/change_sex')}",
					type:"post",
					data:{sexs:sexs},
					datatype:"json",
					success: function(result){
		             	if(result == 1){
		                 	layer.alert('修改成功',1);
		                 	location.href = "{:U('Mycenter/person_information')}";
		               	}else{
		                 	layer.msg('修改失败',2);
		               	}
		            }
				});
			});
</script>
</body>
</html>
